import React,{Component} from 'react';
import PropTypes from 'prop-types';
import {Modal} from 'antd';
import {createForm} from 'redux-form-utils';
import formConfig from './Modal.config';

@createForm(formConfig)
class ArticleModal extends Component{
    render(){
        const {title,desc,date} = this.props.fields;
        return(
            <Modal
                visible={this.props.visible}
                onCancel = {this.props.hideModal}
                onOk = {this.props.addArticle}
            >
                <div className="form">
                    <div className="control-group">
                        <label>标题</label>
                        <input type="text" {...title}/>
                    </div>
                    <div className="control-group">
                        <label>描述</label>
                        <textarea {...title}/>
                    </div>
                    <div className="control-group">
                        <label>发布日期</label>
                        <input type="date" {...title}/>
                    </div>
                </div>
                {/* <button onClick={this.props.onOk}>确认</button>
                <button onClick={this.props.onCancel}>取消</button> */}
            </Modal>
        );
    }
}

export default ArticleModal;
